import { AppCTX } from "../../types/koaExtend";
import { createSpokesmanApiMWRouter } from "../../middleware/spokesman-api/brandSpokesmanChecker";
import {
  endorseActivityByS,
} from "../../service/activityService";
const router = createSpokesmanApiMWRouter();

// 代言活动

// 新增代言活动
router.post("/spn/:spokesmanId/activity", async (ctx: AppCTX, next) => {
  const { spokesmanId } = ctx.params;
  const { endorseActivityId } = ctx.request.body;
  const { userId } = ctx;

  const activity = await endorseActivityByS(endorseActivityId, userId);

  ctx.body = {
    ...activity,
  };
});

export default router;
